import {DeleteByIdRes, QueryParams, QueryRes, SaveParams, SaveRes} from "@/api/daily/seat/type.ts";
import request from "@/utils/request.ts";

/**
 * 删除
 * @param {string} id
 * @returns
 */
export function deleteById(id: number): Promise<DeleteByIdRes> {
    return request.delete(`/business/admin/dailyTrainSeat/delete/${id}`);
}

/**
 * 查询列表
 * @param {object} params DailyTrainSeatQueryReq
 * @param {number} params.pageNum
 * @param {number} params.pageSize
 * @returns
 */
export function query(params: QueryParams): Promise<QueryRes> {
    return request.post(`/business/admin/dailyTrainSeat/quest-list`, params);
}


/**
 * 保存-编辑
 * @param {object} params DailyTrainSeatSaveReq
 * @param {number} params.id
 * @param {object} params.date
 * @param {string} params.trainCode
 * @param {number} params.carriageIndex
 * @param {string} params.row
 * @param {string} params.col
 * @param {string} params.seatType
 * @param {number} params.carriageSeatIndex
 * @param {string} params.sell
 * @param {object} params.createTime
 * @param {object} params.updateTime
 * @returns
 */
export function save(params: SaveParams): Promise<SaveRes> {
    return request.post(`/business/admin/dailyTrainSeat/save`, params);
}